﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Labs
{
    public class NameClass
    {
        string firstname;
        string lastname;
 
        //public static bool operator ==(NameClass a, NameClass b)
        //{
        //    return (a.Firstname == b.Firstname && a.Lastname == b.Lastname);
        //}
        //public static bool operator ==(NameClass a, String fullname)
        //{
        //    return (a.Fullname == fullname);
        //}



        public int CalculateDogYears(int humanage)
        {
            return humanage * 7;
        }
        public int CalculateDogYears(string humanage)
        {
           

            int age = int.Parse(humanage);
            return CalculateDogYears(age);
        }


        public void Showem(params string[] args)
        {
            foreach (string arg in args)
            {
                Console.WriteLine(arg);
            }
        }

        public string this[string propname]
        {
            get
            {
                if (propname == "first")
                    return Firstname;
                else if (propname == "last")
                    return Lastname;
                else if (propname == "full")
                    return Fullname;
                else
                    return "huh?";
            }
        }

        public string Firstname
        {
            get { return firstname; }
            set { firstname = value; }
        }

        public string Lastname
        {
            get { return lastname; }
            set { lastname = value; }
        }

        public string Fullname
        {
            get { return Firstname + " " + Lastname; }
        }
    }
}
